package org.lanqiao.tjut.chengxu14;

import java.util.Scanner;

import org.junit.Test;

public class Chengxu14 {
	// 输入某年某月某日，判断这一天是这一年的第几天？
	@Test
	public void test() {
		System.out.println("分别输入年份，月数，日期");
		Scanner input0 = new Scanner(System.in);
		int a = input0.nextInt();
		Scanner input1 = new Scanner(System.in);
		int b = input1.nextInt();
		Scanner input2 = new Scanner(System.in);
		int c = input2.nextInt();
		int m = test1(b);
		if (a > 0) {
			if (a % 400 == 0 || (a % 4 == 0 ^ a % 100 == 0)&&b>2) {
				System.out.println("这一天是这一年的第" + (m +c+ 1) + "天");

			} else {
				System.out.println("这一天是这一年的第" + m+c + "天");

			}
		}
	}

	public int test1(int b ) {
		int d=0;
		int n = 0;
		for (int i = 0; i < b; i++) {
			if (i == 1) {
				n = 31;
			}if (i == 2) {
				n = 28;
			}if (i == 3) {
				n = 31;
			}if (i == 4) {
				n = 30;
			}if (i == 5) {
				n = 31;
			}if (i == 6) {
				n = 30;
			}if (i == 7) {
				n = 31;
			}if (i == 8) {
				n = 31;
			}if (i == 9) {
				n = 30;
			}if (i == 10) {
				n = 31;
			}if (i == 11) {
				n = 30;
			}if (i == 1) {
				n = 31;
			}
			d = d+n ;

		}
		return d;

	}

}
